import unittest

# 模块名加载
# loader = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo1')
# 类名加载
# loader1 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo1.Demo1Test')
# 方法名加载`
loader1 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo1.TestDemo1TestCase.test1')
loader2 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo2.TestDemo2TestCase.testb')

# suite 套件组装
suite = unittest.TestSuite()
suite.addTests([loader1, loader2])

# runner 执行方法
runner = unittest.TextTestRunner()
runner.run(suite)
